
//
//  Status.m
//  kuangjia
//
//  Created by 张帅 on 15/10/1.
//  Copyright © 2015年 ZhangShuai. All rights reserved.
//

#import "Status.h"

@implementation Status


-(instancetype)initWtihDict:(NSDictionary *)dict{
    if (self=[super init]) {
        
        [self setValuesForKeysWithDictionary:dict];
    }
    return self;

}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{

}


-(void)setValue:(id)value forKey:(NSString *)key{
    
    [super setValue:value forKey:key];
    
    if ([key isEqual:@"user"]) {
        
        self.user =[[User alloc] initWtihDict:value];
        return;
    }
    if ([key isEqualToString:@"retweeted_status"]) {
        
        self.retweeted_status=[[Status alloc] initWtihDict:value];
        return;
    }
    
}
-(NSString *)description{

    
    NSArray *key = @[@"created_at",@"id",@"text",@"source",@"pic_urls",@"retweeted_status"];
    
    return [self dictionaryWithValuesForKeys:key].description;
}

@end
